---@class Table_GlobalDialogItem
local Table_GlobalDialogItem = class("Table_GlobalDialogItem");

function Table_GlobalDialogItem:ctor()
    self.Id = 0;    --唯一ID
    self.TipType = 0;    --对话框类型
    self.Title = 0;    --对话标题ID
    self.ContentId = 0;    --内容ID
    self.BtnName = {};    --按钮文本ID
    self.TapClose = false;    --是否显示关闭
end

function Table_GlobalDialogItem:Load(reader)
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.Id = tonumber(self.temp); end
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.TipType = tonumber(self.temp); end
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.Title = tonumber(self.temp); end
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.ContentId = tonumber(self.temp); end
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.BtnName = Utility.StringToNumbers(self.temp, ";"); end
    self.TapClose = reader:ReadBool();
    self.temp = nil;
end

---@class Table_GlobalDialogMgr : IDataMgr
local Table_GlobalDialogMgr = class("Table_GlobalDialogMgr", IDataMgr);

function Table_GlobalDialogMgr:FileName()
    return "Txt/GlobalDialog.txt";
end

---@return Table_GlobalDialogItem
function Table_GlobalDialogMgr:GetItemById(id)
    return self.super:GetItemById(id)
end

---@return Table_GlobalDialogItem
function Table_GlobalDialogMgr:GetItemByIdx(idx)
    return self.super:GetItemByIdx(idx)
end

function Table_GlobalDialogMgr:Load(reader)
    local item = Table_GlobalDialogItem.new();
    item:Load(reader);
    self.mItemDic[item.Id] = self.mDataCount;
    table.insert(self.mItemList, item);
end

return Table_GlobalDialogMgr;